added exception management for null uri