Added some validations and stuff