Fixes the bug of the extra line after editing