fixed #306, #304