bugfix: i should have been p_len