creating a modal controller