append and remove element problems fixed