refactored the modal to use ctools modal.