removed obsolete argument and added error logging