fixed bug when no database is found for ws gateway