bug fixs

previous version does not work on platform