Added instance detection using shared memory