move actionbar updating function to MainActivity