added script for navbar dropdown to function