add enterForeground & enterBackground