should fix some obvious bugs