edited add() function in c_posts