fixed a bug with night checkbox