Added validations and other fixes