added format checking