reinstated old code for modal()