activation function handling added