do not add useless nil when last statement is return