Fix JS calls made in wrong order