Added some additional checks