home-after logic added

some problems fixed