fix non-valid objects bug