added debug.log for logging errors