fixed p-value calcuation but when p=1.0