fixed bug with the init endpoint