Fixed sql id issue