fixed out of bounds bug in controls