improved transition JS