Added a check for the appname flag