added ft_error, some cleanup