update code for loading modal