A generalization of fixed point theorems in $S$-metric spaces