addded build task; fixed some bugs;