fixed a stupid implementation