fixing a bug with the -f option