add new function to get stage by code