error handling when creating deposition