added some regex checking