fix build and create a functional dist