fixed bug for -p option