fixing bugs that got overwritten