added sell log to history, fixed bug in sell (didnt check for empty array)