Fixed main activity so it does not crash the application