define validation in intialize method to make it work with modules

closes #85