Added wpdb prefix to post exists query