add deleteElement function