added a few more checks