Updated to fix midnight bug