bugfixes in modal js