used get_object_or_404() instead of an if statment