updated remove functionality