Fixed SQL logging feature in individual existence function.