lost in flask context land... have to fix it later