fixing ajax async

@adamggg