Correct the error that was appearing before when the marker was to be removed