fixed pman function to work properly