Replaced regex check to indexof for environments