This Fixes #906,#899

Used visibility attribute to show hide close button