Simply validation function - return error instead of callback function