fixes bugs with method