added logging to see what is happening