Error Handling added