fix bug setting the coordinates