Fixed bug caused by not paying enough attention