fixed bugs in away() function when building duration for popup.