added many more checks