Moved function to check if validation works