Fixed post dublication bug and tidied up the posts model