On the solution of the fractional nonlinear Schrödinger equation