modified compute_current_path and added support for DynamicPolicy