changed db name in function query