validations added and make sure key does not contain spaces