Please don’t take that comment as personal. If he’s been there for a while, he might know something that you cannot see as well. And you thought that he was friendly to you. I think you have to listen what he comments. Please also check with other co-workers or your manager for your situation how they think about you too. Sorry, my advise was more directed on your stuff. However, you would do better if you take this opportunity to improve.