wrapped all safetyCheck in function: safetyCheck; fixed bug in safetyCheck