check that first or last options exist before using