Fixing bug in hostname check regex