fix duplication events when loading from database
logging improvements