fixing -x to work with pipes