fix tests for handling emails