FIXED p_data_action to include old data.. its SLOW. testing before optimizing..