fixed similar issue in environment and repositories controllers