added optional second parameter to modal.js and updated all places with its usage