Please move this below, and add variable `$type = 'error'`, and `$type = 'success'`.