fix bug in function next_post_field
fix code style