That is the reason behind it. If you are in a different atmosphere, the thought gets diluted. Circumstances and the atmosphere around you have a great influence. This is to give an example of how circumstances and the atmosphere around have an influence upon oneself. That is why it is said that the most important requisite for a spiritual seeker is company of good people, called satsanga .
Nothing is equal to satsanga .
The company of noble persons is the best remedy for every kind of problem in spiritual life. The books that you read and the company that you keep will tell something about you. Devote some time to reading elevating literature, generating noble thoughts, and don't keep company with people who will distract your mind. In modern days people have company of television, cinema and clubs. This is the company that people keep, and you can know how dissipated the mind can be after having such company.