versioning of js files and fixed #646, #523

fixed issues on loans