attempt at fixing bugs