checking if layer exists first

failing if it does