Add background modes and bugs fixed