fixed code that produces an error

The removeLayer functions was not working for me and I did not understand why you try to remove it two times.