move this line before 
```javascript
if ($('#status_button').val() === 'Avalable') {
```