Added Error Handling.