Fixed undefined variable $reason.

Signed-off-by: crynobone <crynobone@gmail.com>