small change , checking the returned value