Added Exception handeling