created function to remove an item from preferences