Added create posts function