JS solution in sync with CSS fixes