changed $status to $stat to avoid breaking with zsh