Fixed problem with doc.width and height while modal positioning