diff --git a/a/modal.js b/b/modal.js
index 5b417d0..22e1542 100644
--- a/a/modal.js
+++ b/b/modal.js
@@ -405,12 +405,15 @@
           return true;
         }
       }
-      if( $(target).filter('*:visible').parents('#modalContent').size()) {
+      if( $(target).is('#modalContent,body') || $(target).filter('*:visible').parents('#modalContent').size()){
         // allow the event only if target is a visible child node of #modalContent
         return true;
+      }else
+      {
+      	$('#modalContent').focus();
       }
-      if ( $('#modalContent')) $('#modalContent').get(0).focus();
-      return false;
+      event.preventDefault();
+      
     };
     $('body').bind( 'focus', modalEventHandler );
     $('body').bind( 'keypress', modalEventHandler );
