more checks and test function