fixed loading texture problem and made more extendable