fixed collision with screen borders