minor fix and add data select based on date