added some code for a modal support