fixed validation errors in code