Fix bg declaration placement