Changed code for retrieving params