corrected some resource warnings
still not sure about full @Nullable analysis