The present invention relates to compounds of formula I: and pharmaceutically acceptable salts thereof as well as to pharmaceutical compositions comprising these compounds and to methods for their preparation. The compounds are useful for the treatment and/or prevention of diseases which are associated with the modulation of H3 receptors.