fixed pick function and few other minor fixes