fix bug with method not working