finally fixed bad naming in the database function calls