Fixed potential error of nil return