fix for graph_db in case operation applied within a function