Eliminating warning message for unchecked return value