updated code to support params