canvas size bug fixed, undefined detect method changed