Fixed bug in main activity