updated postsLimit to take a limit parameter for pagination