Fix database functional