fixed error with layer