fixed bug in away function.