fixing source index issue by monkey patching