index and reg fix