Modal closes at the clicking cancel button

Move modal controller to common module