fixes for check function