Fixed the slowness!! last added and last deleted lines were not being saved properly!