fixed obvious bugs