fixed if-fi code for PTR and RPTR