Fixed bug and removed dereferencing