fixed modifyLog so it works as expected