added return path logic