topic creation now checks for valid pid as well