diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index d84ce0a5bd6afe483560c1af74bd0f27db60ffc4..01301e0d533b7b73b92ef4c836d7bb173b55cd4d 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -501,6 +501,7 @@ OC.Contacts={
 				clickhandler:function(contact) {
 					OC.Contacts.Contacts.insertContact({contact:contact});
 					OC.Contacts.notify({message:t('contacts', 'Cancelled deletion of: "') + curlistitem.find('a').text() + '"'});
+					window.onbeforeunload = null;
 				}
 			});
 		},