Moved status to js rather than php