improved a few checks