Fixed nullPointerException bug (when an empty space is clicked)