Fixed conditiion for checking repository validity