Changed to load masks only when document is ready