added handling of invalid id in params