Fixed bug with modal controller