You can extend your residence permit for the purpose of research before it expires if you wish to continue your work as a researcher in Germany.