bug fix on reading P6 and add test