few more checks to avoid errors