Adding in check to make sure the cd command is successful