added exists and getStream functions