Added checking that the file belongs to the current project, if not then use dirname of the file instead of projects