Added some santity checking