finalized js calls for buttons