Update lib.js

Fixing issue #168
Merge pull request #181 from mariomc/fix-modal

Update lib.js