added method to js