add util function warn and die.