Fixing nil exception