Changes, added more checks