change ps function