Added fix. Hope its not too rough or sloppy