Fixed check existing file logic.

Signed-off-by: SeynovAM <sejnovalexey@gmail.com>