Fix CloseOnEnd feature

Solution is from:
https://code.google.com/p/conque/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&groupby=&sort=&id=98

Signed-off-by: apporc <appleorchard2000@gmail.com>