fix the obvious bugs