Added print statements to debug crash caused by new code