Added some checking.