first try with modals: some small bugs fixed