Added More Error Handling