fixed auto closing of app when settings is opened

This commit fixes issue of closing of app when users installs app for
the first time and opens settings from drawer which is already opened
for them. Some unused line of codes are also removed.