fixing various bugs that propped up in production
finally working
removed debug print statement