Finally solved js issue