modified to remove element instead of hiding