fixed bug with special database functions