Added a better logic for updating bashrc