modified is_displayed method