fix active path function