fixing incorrect behaviour while handling not found error.