fixed cui post-auth queries for sqlite
fixed cui post-auth queries for mysql