add stack trace if in debug mode and coerce status to 32 bit integer