fix is_submitted function