error handling and better id validation