fixed issue #5! also removed unnecessary logging