fix issue with -p flag