Improved gmail handling