fixed parsing logic and some issues related to deleted remotes