fixed end error