Bug fix - JS