Changed from using startsWith to indexOf since startsWith is not
available in every browser