Fixed multiple errors, now work fine