bug fix in MainActivity