changed base handling in order to prevent duplicate js loading (closes #1560)