                                             $changeEmailForm.trigger 'submit'
 
                                         $changeEmailModal.on 'show.bs.modal', (e) ->
+                                            $('#change-email-new').val ''
                                             $changeEmailSubmitError.text ''
 
                                         $changeEmailModal.on 'shown.bs.modal', (e) ->
-                                            $('#change-email-new').val('').focus()
+                                            $('#change-email-new').focus()
 
                                         $changeEmailForm.on 'submit', (e) ->
                                             e.preventDefault()

                                        $editProfileForm.trigger 'submit'

                                    $editProfileModal.on 'show.bs.modal', (e) ->
                                        $editProfileSubmitError.text ''

                                    $editProfileModal.on 'shown.bs.modal', (e) ->
                                        $('#edit-profile-country').val(team.country).focus()
                                        $('#edit-profile-locality').val team.locality
                                        $('#edit-profile-institution').val team.institution

                                    $editProfileForm.on 'submit', (e) ->
                                        e.preventDefault()

                                            $resendConfirmationForm.trigger 'submit'

                                        $resendConfirmationModal.on 'show.bs.modal', (e) ->
                                            $('#resend-confirmation-email').val team.email
                                            $resendConfirmationSubmitError.text ''

                                        $resendConfirmationModal.on 'shown.bs.modal', (e) ->
                                            $('#resend-confirmation-email').focus()

                                        $resendConfirmationForm.on 'submit', (e) ->
                                            e.preventDefault()
