fixed bug due to use of invalid instead of $checks['errors']