added logging

drilled down open bug to weak understanding of mode as string and integer
in different methods