Fix bug in instance method when need create new instace or read exsisting.

Signed-off-by: Sergey S. Smirnov <SergeySSmirnov@mail.ru>