Improve not found handling