Added some checking functions