fixed check table bug in database