Reworking Error handling