bug fixes, modal improvements