js fixes for close activity