added a bunch of checks