You can still be convicted of embezzlement even if you return the money. If you intended to use it for your own personal purposes back at the time you took it, you may have committed embezzlement. However, the fact that you gave it back should reduce your sentence and/or the amount of any fine or restitution.