modified code logic day parameter now this code is in the application  helper