added validations to controllers