adds special case for first node