wrapped up modal javascript