fixing bugs and adding config