fixed handle bug and fixed coding standards