fixed the general bugs