now correctly handle invalid id