bug fixes, basically fixed #14