fix joystick code