update trash functionality