P command bug fix