spent days searching for this damn bug