one last round of bug fixing