fixed coding problems