Changed post.length to dynamic val, fixed one bug.