added validation in controller