Added some validations to the methods

Added validations to methods.