Bug fix ajax calls