Add Error Handling for debug purposes