SDAM add some error-handling logic