adding a missing check for sources and sinks in the inmemory mode