params.sid is always null at thsi line