fixed returning 0 after successful insert