fix the edit option, and made the data via map instead of single array