checked for logged_in? to avoid nil object