avoid accessing [1] on nil