fixed variable names in createPost method