#7 fixed null pointer exception with logging