fixed log() error- still buggy