move promise warning to ajax method