fixed, about to convert to jquery