remove unnecessary nil