fix malfunctioning