Use get_object_or_404 method instead of try...catch block