Prevent window to go outside browser bounds