Removed return in ajax function

(cherry picked from commit 4df3f41be49e5c12f4fd7970bd59b98998a37a33)
Small code fixes