bug fixes in model/newpost.php