fixed functions to support defined post id