rebuild working properly now