solved 2nd bug but still buggy