Added decrypt function to Worker

and fixed some bugs...