added a few checks