changed if [ ] to [[]]