fixed crappy hacky code.