Found a variable type error. Added a print statement for debugging.