Don't duplicate posts

This should fix the duplicate post issue by first checking for existing posts in the database with the same id.