added checkExists method covered with tests