Fix the bug that user can't use environment when there is environment group