replace print statements with logger debug
catch missing ops more explicitly