Fixing minor bug in guard script