key validation and default valuse implemented