Added validation
Made minor changes