fix error when opening main activity