bugfix: NullpointerException. Adding more debug logs