Sge job polling problem

Close #1176.