fixed problem with AQL functions in multiple databases