gracefully handle length error handling