validation and creating case