fix index and add edit