You're not looking at the function's return value here (looks to me like you should just drop the return value, but if you provide it you need to look at it).