Added safe handling for params