fixed custom sqls