some bug fixes for post generation