Adding one more check and removing print statements