adjust rate function for checking params