updated post querying functionality