fixing various bugs that propped up in production
finally working