finish fixing many bugs