Small bug fix on flags js