fix index out of range error
joystick now behaves correctly when scaled