fixing bug and changing time interval