added loging function
bugfix deletion (comit was missing)