ajax out of bounds fix