direct return gave me `nil pointer dereference` error