a little better bad js solution