made edit work correctly