updated edit functionality