changed build function to work with silex and symfony