problem with sigmoid derivative