removed trailing blank line
replaced if ! with unless