Added more checking functions