Not registering listeners if the file does not exists

Solves the problem of writing to a non-existent file when you create a class.
Merge pull request #91 from caiusb/new-class-bug

Not registering listeners if the file does not exists