added few input validations