Error Handling Added