removed some bugs from a merge